<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<title>医诺云检-医院报告查询</title>
		<link rel="stylesheet" href="css/reset.css" />
		<link rel="stylesheet" href="css/mui.min.css" />
		<link rel="stylesheet" href="css/cmms.css" />
		<link rel="stylesheet" href="css/iconfont.css" />
		<link rel="stylesheet" href="css/patient/login-patient.css" />
		<script src="js/vconsole.min.js"></script>
	</head>
	<body>
		<div class="mui-content logBg" id='login' v-cloak>
			<div class="login">
				<img class="yinuo" src="img/ANTreport.png" alt="" />
			</div>
		  	<div class="loginContainer center">
				<div class="mui-input-row">
				    <input type="tel" class="mui-input-clear" placeholder="请输入医院账号" v-model="hospitalCode">
				</div>
				<div class="mui-input-row">
				    <input type="password" placeholder="请输入密码" v-model="docPassword">
				</div>
				<div class="btn">
				    <button type="button" @tap='login'>登 录</button>
				</div>
		  	</div>
		</div>
		
		<script src="js/mui.min.js"></script>
		<script src="js/vue.js"></script>
		<script src="js/cmms.js?time=333"></script>
		<script src="js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
		<script>
			new Vue({
				el:'#login',
				data:{
					hospitalCode:'',
					docPassword:'',//密码
					token:''
				},
				mounted(){
//					var vConsole = new VConsole();
					console.log(location.href);
//					this.login();
				},
				methods:{
					login:function(){
//						location.href='pages/hospitalReport/reportSearch.html?hospitalCode=101999';
						let _this = this;
						if(_this.hospitalCode==''){
							mui.alert('请输入医院账号');
							return false;
						}
						if(_this.docPassword==''){
							mui.alert('请输入密码');
							return false;
						}  
					   	$.ajax({
					   		type:"get",
					   		url:"https://antreport.ulabmed.com:8081/ReportAshx/LoginHandler.ashx",
					   		async:true,
					   		data:{
					   			action:'HospitalLogin',
								HospitalCode:_this.hospitalCode,
								PassWord:_this.docPassword,
								jsonpCallback:"cb"
					   		},
					   		dataType:"jsonp",
					   		success:function(data){
					   			console.log(data[0].Msg);
					   			var data = data[0];
					   			if(data.Success==true){
					   				_this.token = data.Value;
					   				localStorage.setItem('hospi_token',_this.token);
					   				location.href='pages/hospitalReport/reportSearch.html?hospitalCode='+_this.hospitalCode;
					   			}else{
					   				mui.toast(data.Msg);
					   			}
					   		},
					   		error:function(err){
					   			console.log(err)
					   		}
					   	});
					}
				}
			})
		</script>
	</body>
</html>  
